﻿<div>

<h2>JavaScript 代码：</h2>
<textarea name="dp-syntaxhighlighter" class="brush: js; highlight: [6,15,16,17]" >
    
    $(function () {
        $("#Button1").click(function () {
            $.easyui.showDialog({
                title: "Dialog1",
                top: 150, left: 170, width: 400, height: 200,
                topMost: false,
                href: "dialog/easy/useParent/subpage.html"
            });
        });

        $("#Button2").click(function () {
            $.easyui.showDialog({
                title: "Dialog2",
                top: 150, left: 170, width: 400, height: 200,
                href: "dialog/easy/useParent/subpage-iframe.html",
                topMost: false,
                iniframe: true
            });
        });
    });

</textarea>
<h2>HTML 代码：</h2>
<textarea name="dp-syntaxhighlighter" class="brush: html; highlight: []" >
    
    这是用于被操作的输入框：<input id="Text1" type="text" style="width: 300px;" />
    <hr />
    <input id="Button1" type="button" value="创建Dialog1" />
    <input id="Button2" type="button" value="创建IFRAME-Dialog2" />

</textarea>

<hr />
<h2>Dialog1 加载的页面中的代码：</h2>
<h4>JavaScript 代码</h4>
<textarea name="dp-syntaxhighlighter" class="brush: js; highlight: [2]" >
    $("#SubPageButton1").click(function () {
        $("#Text1").val("aaaaaaaaaaaaaa from dialog1");
    });
</textarea>
<h4>HTML 代码</h4>
<textarea name="dp-syntaxhighlighter" class="brush: html; highlight: []" >
    <input id="SubPageButton1" type="button" value="操作父级窗口的INPUT" />
</textarea>


<hr />
<h2>Dialog2 加载的页面中的代码：</h2>
<h4>JavaScript 代码</h4>
<textarea name="dp-syntaxhighlighter" class="brush: js; highlight: [3,4]" >
    $(function () {
        $("#SubPageIframeButton1").click(function () {
            var jq = $.easyui.parent.$;
            jq("#Text1").val("bbbbbbbbbbbbbb from dialog2");
        });
    });
</textarea>
<h4>HTML 代码</h4>
<textarea name="dp-syntaxhighlighter" class="brush: html; highlight: []" >
    <link href="../../../../jquery-easyui-1.3.4/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../../jquery-easyui-1.3.4/themes/icon.css" rel="stylesheet" type="text/css" />

    <script src="../../../../jquery/jquery-1.10.2.js" type="text/javascript"></script>
    <script src="../../../../jquery-easyui-1.3.4/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../../jquery-easyui-1.3.4/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>

    <script src="../../../../jquery.jdirk.js" type="text/javascript"></script>
    <script src="../../../../jeasyui-extensions/jeasyui.extensions.js" type="text/javascript"></script>

    <script src="../../../../jeasyui-extensions/jeasyui.extensions.menu.js" type="text/javascript"></script>
    <script src="../../../../jeasyui-extensions/jeasyui.extensions.panel.js" type="text/javascript"></script>
    <script src="../../../../jeasyui-extensions/jeasyui.extensions.window.js" type="text/javascript"></script>
    <script src="../../../../jeasyui-extensions/jeasyui.extensions.dialog.js" type="text/javascript"></script>

    <input id="SubPageIframeButton1" type="button" value="操作父级窗口的INPUT" />
</textarea>



</div>